1. Field
This disclosure relates to generating and analyzing traffic for testing a network or network device.
2. Description of the Related Art
In many types of communications networks, each message to be sent is divided into portions of fixed or variable length. These portions may be referred to as packets, frames, cells, datagrams, or data units, all of which are referred to herein as packets. Communications networks that transmit messages as packets are called packet switched networks.
Each packet contains a portion of the original message, commonly called the body of the packet. The body of a packet may contain data, or may contain voice or video information. The body of a packet may also contain network management and control information. In addition, each packet contains identification and routing information, commonly called a packet header. The packets are then sent individually over the network through multiple switches or nodes and then reassembled at a final destination using the information contained in the packet headers, before being delivered to a target device or end user. At the receiving end, the reassembled message is passed to the end user in a format compatible with the user's equipment.
Most packet switched networks operate according to a set of established protocols, implemented in a collection of interfaced layers known as a protocol stack. These layers may be defined according to the Open Systems Interconnect (OSI) model, having seven layers (from top to bottom): application, presentation, session, transport, network, data-link and physical.
All but the physical layer of a protocol stack are typically software, though the network and data-link layer may be firmware and/or hardware. Each layer of the protocol stack typically exists to perform a specific function, such as addressing, routing, framing and physical transmission of packets. When a packet is to be transmitted over a network from a source system to a destination system, the packet will pass in a logically downward direction through layers of the protocol stack on the source system, and in a logically upward direction through corresponding layers of the protocol stack on the destination system. Each layer passes the packet to the adjacent layer, either up or down the protocol stack depending on whether the packet has been received or is being transmitted.
Each layer of the protocol stack in the transmitting process may add a respective header to the packet, which provides information to the corresponding layer in a receiving process. Thus, as a packet passes down through the protocol stack on a transmitting system, the packet may gain an additional header at each layer. At the bottom of the stack, the transmitting process may then frame the packet and physically transmit it over the network toward its destination. When the packet reaches its destination, the packet will then pass up through the protocol stack of the destination system. Each layer of the protocol stack in the destination system may obtain useful information from its associated header and will strip its header from the packet before passing the packet up to the next layer for processing.
One or more layers of the protocol stack in the transmitting process may partition or fragment a packet into multiple packets of shorter length before passing the packets to the next lower layer in the stack. When the packet fragments reach their destination, the original packet will be reassembled as the fragments pass up through the protocol stack of the destination system.
A variety of standards are known for use in packet switched networks. One of the best known of these, the TCP/IP suite, is typically used to manage reliable transmission of packets throughout the Internet and other IP networks. The TCP/IP standard defines five layers: physical, link, network (IP), transport (TCP) and application. These layers correspond to layers 1, 2, 3, 4 and 7 of the OSI model respectively. Common practice, however, is to describe layers 1, 2, 3, and 4 as the TCP/IP stack, and to view the application layer as lying on top of the stack.
The transport layer of TCP/IP corresponds to layer 4 of the OSI model. The transport layer allows source and destination machines to carry on a reliable conversation with each other. A second commonly-used transport layer protocol is the UDP (User Datagram Protocol). Unlike TCP, UDP provides no error recovery or reliability mechanisms. Because of this simplicity, UDP packets have shorter headers than TCP packets, and thus consume fewer system resources. Among other applications, UDP may be used to transmit real-time audio or video content.
The IP layer in TCP/IP or UDP/IP corresponds to the network layer of the OSI model. The IP layer provides addressing information to facilitate independent routing of packets within or between networks.
The link layer under TCP/IP or UDP/IP corresponds to the data-link layer of the OSI model. The link layer includes network interface card drivers to connect the machine to the physical network, such as an Ethernet network.
In general, the machines that implement the TCP/IP protocol stack are computers. Each of these computers includes one or more processors, memories, and input/output ports, and is managed by an operating system.
The computer memory may include a user space and a kernel space. The kernel space is an area of memory which is strictly reserved for running the kernel, device drivers and any kernel extensions. The TCP/IP protocol stack typically resides in kernel space, and higher level protocols such as HTTP, RTP, and RTCP typically reside in user space. Though some portions of the kernel space may be swapped (paged) out to the disk, some portions are typically never swappable. The user space is a memory area used by all applications and this memory can typically be swapped out at any time depending upon the current system requirements. The user space and the kernel space are distinct. An application program usually cannot access the kernel space directly. Application programs may, however, use the kernel to access system resources and hardware through system calls, and are therefore thought of as running above, or on top of, the kernel.
Typically, when an incoming packet enters a computer or other hardware device running a protocol stack, the destination of the packet may be some specific code within the kernel, or it may be an application program. In any event, the packet will typically be processed by multiple layers of the protocol stack and finally arrive at its destination. Similarly, an outgoing packet will typically be processed by multiple layers of the protocol stack before being transmitted onto the network. In some cases, a packet may pass through one or more layers of the protocol stack multiple times before being transmitted onto the network, or before being passed on to its destination. At any instant in time, multiple packets may be in process or held at any or all of the layers of the protocol stack.